package com.zkw.group.service;

import com.zkw.group.entity.ProfesIndicatorTwo;
import com.zkw.group.mapper.ProfesIndicatorTwoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProfesIndicatorTwoService {

    @Autowired
    private ProfesIndicatorTwoMapper profesIndicatorTwoMapper;

    //获取二级指标列表
    public List<ProfesIndicatorTwo> getAllIndicatorTwoList(String sindicname,String fid, int pageStart, int pageSize){
        return profesIndicatorTwoMapper.getAllIndicatorTwoList(sindicname,fid,pageStart,pageSize);
    }

    //获取二级指标条目数
    public int getIndicatorTwoCounts(String sindicname,String fid){
        return  profesIndicatorTwoMapper.getIndicatorTwoCounts(sindicname,fid);
    }

    //添加二级指标
    public int addIndicatorTwo(ProfesIndicatorTwo profesIndicatorTwo){
        return profesIndicatorTwoMapper.addIndicatorTwo(profesIndicatorTwo);
    }

    //删除指定二级指标
    public int deleteIndicatorTwo(String sindicname){
        return profesIndicatorTwoMapper.deleteIndicatorTwo(sindicname);
    }

    //获取要更新的二级指标信息以及更新指定二级指标信息
    public ProfesIndicatorTwo getUpdateIndicatorTwo(String sindicname){
        return profesIndicatorTwoMapper.getUpdateIndicatorTwo(sindicname);
    }

    public int updateIndicatorTwo(ProfesIndicatorTwo profesIndicatorTwo){
        return profesIndicatorTwoMapper.updateIndicatorTwo(profesIndicatorTwo);
    }
}
